package com.acme.task6;

public class PreProceessor {
	public static void main(String[] args) {
		
		boolean isLineCommented = false;
		boolean isBlockCommented = false;
		
		for (int j = 0; j < args.length; j++) {
			
			String str = args[j];
			isLineCommented = false;
			
			for (int i = 0; i < str.length(); i++) {
				
				if (str.charAt(i) == '/'
						&& (i < str.length()-1) 
						&& str.charAt(i+1) == '/' ) {
					isLineCommented = true;
				}
				
				if (str.charAt(i) == '/'
						&& (i < str.length()-1) 
						&& str.charAt(i+1) == '*' ) {
					isBlockCommented = true;
				}
				
				if (str.charAt(i) == '*'
						&& (i < str.length()-1) 
						&& str.charAt(i+1) == '/' ) {
					if (isBlockCommented){
						isBlockCommented = false;
						i++;
						continue;
					} else {
						System.out.println("SYNTAX ERROR: '*/' should be used only after '/*' ");
					}
				}
				
				if ( !isBlockCommented && !isLineCommented ){ 
					System.out.print(str.charAt(i));
				}
			}
			System.out.println();
		}
	}
}